<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
require_once app_path("Http/Route").'/admin.php';


//地址录入
require_once app_path("Http/Route").'/home.php';





//地址录入
require_once app_path("Http/Route").'/home.php';





//前台个人中心
require_once app_path("Http/Route").'/personal.php';


//引入栏目列表的路由
require_once app_path("Http/Route").'/cat.php';

//前台地址
require_once app_path("Http/Route").'/home.php';



Route::get('/', function () {
    return view('welcome');
});


//商家后台merchant(商家)
require_once app_path("Http/Route").'/merchant.php';

//项目前台首页
Route::get('/', function () {
    return view('home.index');
});

//加载前台用户注册页面
Route::get('homeRegister', 'Home\homeRegisterController@register');
//执行用户注册
Route::post('homeRegister', 'Home\homeRegisterController@postRegister');
//邮件激活操作
Route::get('homeActivation', 'Home\homeRegisterController@mailActivation');

//执行用户登陆
Route::post('homeLogin', 'Home\homeRegisterController@postLogin');
//执行用户退出
Route::get('homeLogout', 'Home\homeRegisterController@logout');
//验证码
Route::get('homeCode', 'Home\homeRegisterController@code');
//购物车
Route::resource('homeCart', 'Home\cartController');
Route::group(['middleware'=>'cart'],function(){
Route::resource('addCart', 'Home\addCartController');
//执行添加购物车操作

Route::get('addCart/{c}/{d?}', 'Home\addCartController@cartAdd');
Route::resource('addCartList', 'Home\addCartListController');
});
//前去查看订单
Route::resource('order', 'Home\orderController');

//前台首页路由

Route::any('/', 'Home\IndexController@index');

